Mock.mock("/js/gwchuixian","post",function(){
    // 获取购物车本地存储
    let carString = localStorage.Car;
    let carobj = JSON.parse(carString);
    return carobj;
})

Mock.mock("/js/shanchu","post",function(obj){
    let objbody = JSON.parse(obj.body)
    // console.log(objbody.i);
    // 获取购物车本地存储
    let carString = localStorage.Car;
    let carobj = JSON.parse(carString);
    // console.log(carobj);
    let arr=[]
    for(let i=0;i<carobj.length;i++){
        console.log(carobj[i]);
        if(i != objbody.i){
            arr.push(carobj[i])
        }
    }
    // console.log(arr);
    localStorage.Car = JSON.stringify(arr);
    return true
})